<?php
if (isset($_GET['o']) &&  !empty($_GET['o']) ){
    include 'load.php';
    $openid=$_GET['o'];
    
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    if (!$mysqli->set_charset("utf8")) {}
    
    $query=$mysqli->query("SELECT nickname,unionid,province,city FROM users where openid='".$openid."' limit 0,1 ");
    $name='';
    if($query->num_rows>0){
        $userInfo=$query->fetch_array();
        echo json_encode(array('id'=>$userInfo['unionid'],'n'=>$userInfo['nickname'],'p'=>$userInfo['province'],'c'=>$userInfo['city'])); 
    }else{
        echo json_encode(array('id'=>'','n'=>'','p'=>'','c'=>'')); 
    }
    $mysqli->close();
    
}